import axios from 'axios';

const http = axios.create({
    baseURL: import.meta.env.VITE_APP_BASE_URL,
    timeout: 10000,
});

// Initialize instance defaults
http.defaults.headers['Content-Type'] = 'application/json;charset=utf-8';

// Request interceptor
http.interceptors.request.use(
    config => {
        return config;
    },
    error => {
        Promise.reject(error);
    },
);

// Response interceptor
http.interceptors.response.use(
    response => {
        return response;
    },
    error => {
        Promise.reject(error);
    },
);

export default http;
